package com.itcam.cm.user.service.impl;

import com.itcam.cm.model.entity.user.AuthContextUtil;
import com.itcam.cm.model.entity.user.UserAddress;
import com.itcam.cm.model.entity.user.UserInfo;
import com.itcam.cm.user.mapper.UserAddressMapper;
import com.itcam.cm.user.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserAddressServiceImpl implements UserAddressService {

    @Autowired
    UserAddressMapper userAddressMapper;

    @Override
    public List<UserAddress> findUserAddressList() {
        return userAddressMapper.selectUserAddressList(AuthContextUtil.getUser().getId());
    }

    @Override
    public UserAddress getUserAddress(Long userAddressId) {
        return userAddressMapper.selectUserAddressById(userAddressId);
    }
}
